window.addEventListener("load", rotate, false);
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", rotate, false);
function rotate() {
	if (window.orientation == 180 || window.orientation == 0) {
		alert('竖屏')
	}
	if (window.orientation == 90 || window.orientation == -90) {
		alert('横屏')
	}
}